﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
using Volo.Abp;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using Bridge.Shared.Enums.Wms;

namespace Stock
{
    [Comment("产品批次库存表")]
    [Table("t_producttrackstock")]
    public class ProductTrackStock : AuditedAggregateRoot<Guid>, ISoftDelete, IMultiTenant
    {
        public ProductTrackStock(Guid keyId)

        {
            this.Id = keyId;
        }

        public ProductTrackStock()
        {

        }

        [Comment("科室ID")]
        public Guid DeptId { get; set; }

        [Comment("科室名称")]
        [MaxLength(200)]
        public string DeptName { get; set; }


        [Comment("产品编码")]
        [MaxLength(100)]
        public string ProductCode { get; set; }

        [Comment("套包编码")]
        [MaxLength(100)]
        public string PackageCode { get; set; }

        [Comment("套包名称")]
        [MaxLength(200)]
        public string PackageName { get; set; }

        [Comment("套包手术名称")]
        [MaxLength(200)]
        public string OperationName { get; set; }

        [Comment("产品名称")]
        [MaxLength(300)]
        public string ProductName { get; set; }

        [Comment("产品通用名")]
        [MaxLength(300)]
        public string OtherName { get; set; }

        [Comment("计量单位名称")]
        [MaxLength(100)]
        public string UseUnit { get; set; }

        [Comment("中包装数量")]
        [Column(TypeName = "decimal(18,4)")]
        public decimal MidPackCount { get; set; }

        [Comment("库存类型（1-定数 2-套包 3-数量 4-骨科定数包）")]
        public StockTypeEnum StockType { get; set; }

        [Comment("定数数量")]
        [Column(TypeName = "decimal(18,4)")]
        public decimal DefiniteNum { get; set; }

        [Comment("库存数量")]
        [Range(0, int.MaxValue, ErrorMessage = "库存数量必须大于0")]
        public decimal StockCount { get; set; }

        [Comment("单价")]
        [Column(TypeName = "decimal(18,4)")]
        public decimal Price { get; set; }

        [Comment("产品批号")]
        [MaxLength(100)]
        public string ProductBatch { get; set; }

        [Comment("产品大类名称")]
        [MaxLength(100)]
        public string ProductClassName { get; set; }


        [Comment("产品大类ID")]
        public Guid? ProducttClassId { get; set; }

        [Comment("产品小类名称")]
        [MaxLength(100)]
        public string ProductMinClassName { get; set; }
   
        [Comment("产品小类ID")]
        public Guid? ProductMinClassId { get; set; }

        [Comment("生产日期")]
        public DateTime? ProductDate { get; set; }

        [Comment("生产厂家")]
        [MaxLength(200)]
        public string ManufactureName { get; set; }

    
        [Comment("生产厂家ID")]
        public Guid? ManufactureId { get; set; }
   
        [Comment("有效期")]
        public DateTime? ExpiryDate { get; set; }


        [Comment("货位")]
        [MaxLength(100)]
        public string ShelfCode { get; set; }

        [Comment("批次跟踪码（供应商编码+入库单号+行号）")]
        [MaxLength(100)]
        public string TrackCode { get; set; }

        [Comment("入库单号")]
        [MaxLength(100)]
        public string InStockVoucherCode { get; set; }

     
        [Comment("入库数量")]
        [Column(TypeName = "decimal(18,4)")]
        public decimal InStockCount { get; set; }

        [MaxLength(300)]
        [Comment("规格")]
        public string Specification { get; set; }


        [Comment("供应商ID")]
        public Guid SupplierId { get; set; }


        [Comment("供应商名称")]
        [MaxLength(200)]
        public string SupplierName { get; set; }

        [Comment("条形码")]
        [MaxLength(100)]
        public string BarCode { get; set; }


        [Comment("删除标识")]
        public bool IsDeleted { get; set; }


        [MaxLength(50)]
        [Comment("灭菌批号")]
        public string SterilizationLot { get; set; }

        [Comment("灭菌效期")]
        public DateTime? SterilizationExp { get; set; }

        [MaxLength(255)]
        [Comment("UDI编码")]
        public string UdiCode { get; set; }


        [MaxLength(200)]
        [Comment("唯一条形码")]
        public string OnlyBarCode { get; set; }

        [MaxLength(100)]
        [Comment("序列号")]
        public string SerialNumber { get; set; }


        [Comment("是否唯一码管控(0-否 1-是)")]
        public bool IsBarCodeControl { get; set; }

        [MaxLength(100)]
        [Comment("注册证号")]
        public string RegistrationNumber { get; set; }

        [Comment("盘盈盘亏明细ID")]
        public Guid? CheckStockProfitDetailID { get; set; }


        [Comment("是否领用")]
        public bool IsReceive { get; set; }

        public Guid? TenantId { get; set; }
    }
}
